#ifndef WEATHER_H
#define WEATHER_H

#include <QMainWindow>
#include <QNetworkAccessManager>
#include <QNetworkReply>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonArray>
#include <QJsonValue>
#include <QByteArray>
#include <QFile>
#include <QStandardItemModel>
#include <QMouseEvent>
#include <QToolTip>

#include "mystyleditemdelegate.h"
#include "maininterface.h"

namespace Ui {
class weather;
}

class weather : public QMainWindow
{
    Q_OBJECT

signals:
    void open();

public:
    explicit weather(QWidget *parent = nullptr);
    ~weather();
    void analysis(QByteArray byte);

public slots:
    void replyFinished(QNetworkReply *reply);
    void mousePressEvent(QMouseEvent *event);
    void mouseMoveEvent(QMouseEvent *event);

private slots:
    void on_closeButton_clicked();

    void on_searchPushButton_clicked();

private:
    int size;
    QStringList list;
    Ui::weather *ui;
    QStandardItemModel * model;
    QNetworkAccessManager * manager;
    QPoint mouseOff;
    myStyledItemDelegate * mS;
    QString city,parent;
};

#endif // WEATHER_H
